home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00b.txt
/
000087_icon-group-sender_Mon Oct 23 08:17:58 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9NFHa318406
for icon-group-addresses; Mon, 23 Oct 2000 08:17:36 -0700 (MST)
Message-Id: <200010231517.e9NFHa318406@baskerville.CS.Arizona.EDU>
From: Cheyenne Wills <cheyenne_wills@qwest.net>
X-Accept-Language: en
X-Newsgroups: comp.lang.icon
Subject: Re: How to "declare" a string?
Date: Sun, 22 Oct 2000 15:28:41 -0600
X-Trace: news.uswest.net 972250031 63.227.115.85 (Sun, 22 Oct 2000 16:27:11 CDT)
To: icon-group@cs.arizona.edu
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 1144
> traditional sense of a programming language. Soooo...uhhh....???
>
> As a secondary question, this is part of a program to converst a string
> to all uppercase. Right now I'm doing in a WHILE...DO loop. But
> something tells me there's amcuh more efficient way to do it (with EVERY
> perhaps?) Any suggestions?
data := "Some MiXed CaSed Data"
newdata := map(data,&lcase,&ucase)
--> newdata now contains "SOME MIXED CASED DATA"
The map function searches in the first parameter every instance of each
character in the second parameter and replaces that character with a
character from the third parameter that is in the same "position" as the
character in the 2nd...
I hope that sounded clear...
Here is an example:
# 12345 12345
map("some data","aeiou","!@#$%") -> "s$m# d!t!"
The above does the following mapping
a -> !
e -> @
i -> #
o -> $
u -> %
You can also use map to rearrange data
# mm/dd/yyyy yyyy/mm/dd mm/dd/yyyy
map("123456789A","789A612345","10/21/2000")
Will transform a date in the format of mm/dd/yyyy into yyyy/mm/dd. It
uses the third parameter as the "input"
Cheyenne